<script type="text/javascript">
var footFn = {
getId: function(id) {
return document.getElementById(id);
},
getElem: function(selectors) {
return document.querySelector(selectors);
},
getElems: function(selectors) {
return document.querySelectorAll(selectors);
},
show: function(obj) {
obj.style.display = "block";
},
hide: function(obj) {
obj.style.display = "none";
},
/*统计点击下载APP*/
downAPPdom: function(ele, androidId, iosId, orcookie) {
if (!ele) return;
var orcookie = orcookie || false;
ele.addEventListener("click", function(e) {
e.preventDefault();
if (orcookie) {
localStorage["downloadCookie"] = true;
}
var ua = navigator.userAgent.toLowerCase(),
bIsIpad = ua.match(/ipad/i) == "ipad",
bIsIphoneOs = ua.match(/iphone os/i) == "iphone os",
bIsAndroid = ua.match(/android/i) == "android";
if (bIsAndroid) {
var dataId = androidId;
var img = new Image;
img.src = 'http://acount.pcauto.com.cn/wzcount/artbrowse.php?groupname=汽车网&subgroupname=&id=' + dataId + '&title=&response=1';
img.onload = img.onerror = function() {
location.href = "http://www1.pcauto.com.cn/app/20141120/pcautoapp/index.html";
};
} else if (bIsIpad || bIsIphoneOs) {
var dataId = iosId;
var img = new Image;
img.src = 'http://acount.pcauto.com.cn/wzcount/artbrowse.php?groupname=汽车网&subgroupname=&id=' + dataId + '&title=&response=1';
img.onload = img.onerror = function() {
location.href = "http://www1.pcauto.com.cn/app/20141120/pcautoapp/index.html";
};
} else {
location.href = "http://www1.pcauto.com.cn/zt/gz20141020/qcbjdown/downFromWap.html#ad=4672";
}
}, false);
}
};
/*导航条超出可滚动*/
(function() {
var headerTitleNav = footFn.getElem(".header-title-nav");
if (!headerTitleNav) return;
var canScroll = headerTitleNav.scrollWidth - headerTitleNav.offsetWidth;
if (canScroll > 0) {
headerTitleNav.scrollLeft = canScroll;
}
})();
/*分享到微信*/
(function() {
var firstImgs = footFn.getElems("img"),
firstImgSrc = "http://www1.pcauto.com.cn/wap/2013/cms/img/logo.png";
for (var i = 0, len = firstImgs.length; i < len; i++) {
if (firstImgs[i].getAttribute('src').indexOf('http://count') == -1 && firstImgs[i].getAttribute('src').indexOf('http://acount') == -1 && firstImgs[i].getAttribute('src').indexOf('http://i1.3conline.com/') == -1 && firstImgs[i].className.indexOf('imgNotForWx') == -1) {
if (firstImgs[i].getAttribute('src2')) {
firstImgSrc = firstImgs[i].getAttribute('src2');
break;
} else {
firstImgSrc = firstImgs[i].getAttribute('src');
break;
}
}
}
var dataForWeixin = {
appId: "",
imgUrl: firstImgSrc,
url: window.location.href,
title: document.title,
desc: document.getElementsByName('description')[0].content,
fakeid: "",
callback: function() {}
};
var onBridgeReady = function() {
WeixinJSBridge.on('menu:share:appmessage', function(argv) {
WeixinJSBridge.invoke('sendAppMessage', {
"appid": dataForWeixin.appId,
"img_url": dataForWeixin.imgUrl,
"img_width": "120",
"img_height": "120",
"link": dataForWeixin.url,
"desc": dataForWeixin.desc,
"title": dataForWeixin.title
}, function(res) {
(dataForWeixin.callback)();
});
});
WeixinJSBridge.on('menu:share:timeline', function(argv) {
(dataForWeixin.callback)();
WeixinJSBridge.invoke('shareTimeline', {
"img_url": dataForWeixin.imgUrl,
"img_width": "120",
"img_height": "120",
"link": dataForWeixin.url,
"desc": dataForWeixin.desc,
"title": dataForWeixin.title
}, function(res) {});
});
WeixinJSBridge.on('menu:share:weibo', function(argv) {
WeixinJSBridge.invoke('shareWeibo', {
"content": dataForWeixin.title,
"url": dataForWeixin.url
}, function(res) {
(dataForWeixin.callback)();
});
});
};
if (typeof WeixinJSBridge == "undefined") {
if (document.addEventListener) {
document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
}
} else {
onBridgeReady();
}
})();
</script>
<style>
.toTop-btn{display:none;width:30px;height:30px;position:fixed;bottom:52px;right:5px;cursor:pointer;z-index:10;}
.toTop-btn::before{content:'';position:absolute;width:30px;height:30px;background:#333 url() no-repeat 5px 5px;background-size:20px;border-radius:3px;left:0;top:0}
.menu{width:100%;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:flexbox;height:45px;line-height:45px;overflow:hidden;background-color:#007adf;}
.menu a{display:block;-moz-box-flex:1;-webkit-box-flex:1;-ms-flex:1;flex:1;color:#fff;text-align:center;cursor:pointer;}
.menu a:visited{color:#fff;}
.menu a.new{position:relative;}
.menu a.new::after{content:"new";display:block;width:25px;height:12px;text-align:center;line-height:12px;background:#c60000;font-size:12px;position:absolute;top:5px;left:60%;font-weight:normal;font-family:"宋体","Arial",Microsoft YaHei,Microsoft JhengHei;}
.footer{text-align:center;background-color:#F5F6F8;border-top:1px solid #0d81e1}
.footer a,.footer a:visited{color:#444;}
.footer p{margin:8px 0 0;}
.footer .pTit-1{font-size:15px;line-height:28px;}
.footer .pTit-1 a{padding:3px 12px;}
.footer .pTit-1 em{padding:3px 10px;border-radius:3px;color:#1482E0;}
.footer .pTit-3{color:#A0A0A0;font-size:12px;line-height:15px;}
.footer .pTit-4{width:100%;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:flexbox;color:#333;font-size:13px;}
.footer .pTit-4 span{display:block;-moz-box-flex:1;-webkit-box-flex:1;-ms-flex:1;flex:1;margin:0 1px 0 0;text-align:center;padding:0 0 4px;}
.footer .pTit-4 .s-online{border-bottom:3px solid #2251a5;}
.footer .pTit-4 .s-auto{border-bottom:3px solid #ff6702;}
.footer .pTit-4 .s-games{border-bottom:3px solid #cc0202;}
.footer .pTit-4 .s-lady{border-bottom:3px solid #e5187e;}
.footer .pTit-4 .s-baby{border-bottom:3px solid #ffc119;}
.footer .pTit-4 .s-house{border-bottom:3px solid #7b3708;}
/*全站APP下载推广*/
.m-btmlink{}
.m-btmlink::before{content: ''; width: 19px; height: 19px; background: url() 0 0 no-repeat; background-size: 19px;vertical-align:top;display:inline-block;margin:5px 8px 0 0}
</style>
<div class="toTop-btn" title="回顶部" onclick="window.scrollTo(0, 0);"></div>
<div class="menu" id="JmenuB"><a href="http://m.pcauto.com.cn/#ad=4446" class="s1">首页</a><a href="http://m.pcauto.com.cn/auto/#ad=4446">找车</a><a href="http://m.pcauto.com.cn/auto/dealer-search.html#ad=4446">经销商</a><a href="http://m.pcauto.com.cn/auto/market/#ad=4446">购车优惠</a><a href="http://m.pcauto.com.cn/bbs/#ad=4446">论坛</a><a href="http://m.pcauto.com.cn/x/nav/#ad=4446">导航</a></div>
<div class="footer">
<!-- 全站底部APP下载推广 -->
<!-- <div class="m-ftbanner">
<a id="m-btmlink"></a>
</div> -->
<p class="pTit-1">
<a href="http://m.pcauto.com.cn/w/">简版</a>
<em>触屏版</em>
<a href="http://www.pcauto.com.cn/3g/wap2013/jump/">电脑版</a>
<a id="m-btmlink" class="m-btmlink">官方APP</a>
</p>
<p class="pTit-3">太平洋网络旗下网站</p>
<p class="pTit-4"><span class="s-online"><a href="http://g.pconline.com.cn/">电脑网</a></span><span class="s-auto"><a href="http://m.pcauto.com.cn/">汽车网</a></span><span class="s-games"><a href="http://m.pcgames.com.cn/">游戏网</a></span><span class="s-lady"><a href="http://g.pclady.com.cn/">时尚网</a></span><span class="s-baby"><a href="http://m.pcbaby.com.cn/">亲子网</a></span><span class="s-house"><a href="http://m.pchouse.com.cn/">家居网</a></span></p>
</div>
<script type="text/javascript">
/*下载APP模块*/
(function () {
/*点击底部横幅下载*/
footFn.downAPPdom(footFn.getId('m-btmlink'),"CNT1158","CNT1138");
})();
/*回到顶部*/
(function() {
window.addEventListener("scroll", function() {
if (document.documentElement.scrollTop + document.body.scrollTop > 800) {
footFn.show(footFn.getElem(".toTop-btn"));
} else {
footFn.hide(footFn.getElem(".toTop-btn"));
}
}, false);
})();
/*定义cookie函数*/
var Cookie = {
get: function(check_name) {
check_name = encodeURIComponent(check_name);
var a_all_cookies = document.cookie.split(';');
var a_temp_cookie = '';
var cookie_name = '';
var cookie_value = '';
var b_cookie_found = false;
var i = '';
var len = a_all_cookies.length;
for (i = 0; i < len; i++) {
a_temp_cookie = a_all_cookies[i].split('=');
cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');
if (cookie_name == check_name) {
b_cookie_found = true;
if (a_temp_cookie.length > 1) {
cookie_value = decodeURIComponent(a_temp_cookie[1].replace(/^\s+|\s+$/g, ''));
}
return cookie_value;
break;
}
a_temp_cookie = null;
cookie_name = '';
}
if (!b_cookie_found) {
return null;
}
},
set: function(name, value, expires, path, domain, secure) {
var today = new Date();
today.setTime(today.getTime());
if (expires) {
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date(today.getTime() + (expires));
document.cookie = encodeURIComponent(name) + "=" + encodeURIComponent(value) +
((expires) ? ";expires=" + expires_date.toGMTString() : "") +
((path) ? ";path=" + path : "") +
((domain) ? ";domain=" + domain : "") +
((secure) ? ";secure" : "");
},
remove: function(name) {
Cookie.set(name, 1, -1, "/", "pcauto.com.cn");
}
};
/*判断是否客户端来源标识 , 如果是的话把标识存到localStorage或者cookie中*/
(function() {
if (window.location.search.match(/fromPcautoApp/i) == 'fromPcautoApp') {
if (window.sessionStorage) {
try {
sessionStorage.fromPcautoApp = true;
} catch (err) {
Cookie.set("fromPcautoApp", true);
}
} else {
Cookie.set("fromPcautoApp", true);
}
}
})();
/*判断localStorage或者cookie中是否有客户端来源标识 , 如果有的话执行callback函数*/
function fromPcautoApp(fc) {
function callback() {
if (typeof(fc) != 'undefined') {
fc();
};
};
if (window.sessionStorage) {
try {
if (sessionStorage.fromPcautoApp) {
callback();
}
} catch (err) {
if (Cookie.get("fromPcautoApp")) {
callback();
}
}
} else {
if (Cookie.get("fromPcautoApp")) {
callback();
}
}
};
/*执行 callback函数*/
fromPcautoApp(function() {
if (footFn.getElem(".m-hdTop")) {
footFn.hide(footFn.getElem(".m-hdTop"));
}
if (footFn.getId("JtopLink")) {
footFn.hide(footFn.getId("JtopLink"));
}
if (footFn.getElem(".footer")) {
footFn.hide(footFn.getElem(".footer"));
}
if (footFn.getId("JmenuB")) {
footFn.hide(footFn.getId("JmenuB"));
}
if (footFn.getId("JdownloadAppWrap")) {
footFn.hide(footFn.getId("JdownloadAppWrap"));
}
if (footFn.getId("JdlAppTop")) {
footFn.hide(footFn.getId("JdlAppTop"));
}
if (footFn.getId("searchDiv")) {
footFn.hide(footFn.getId("searchDiv"));
}
if (footFn.getId("menuAutoDiv")) {
footFn.hide(footFn.getId("menuAutoDiv"));
}
if (document.getElementById("dealerSearch")) {
document.getElementById("dealerSearch").onclick = function() {
return false;
}
}
});
/*判断是否轻应用标识 , 如果是的话把app下载隐藏*/
(function() {
if (window.location.search.match(/ToQingYingYong/i) == 'ToQingYingYong') {
if (footFn.getId("JAppdownload")) {
footFn.hide(footFn.getId("JAppdownload"));
};
if (footFn.getElem(".pTit-1")) {
footFn.hide(footFn.getElem(".pTit-1"));
};
if (footFn.getId("JdownloadAppWrap")) {
footFn.hide(footFn.getId("JdownloadAppWrap"));
};
if (footFn.getId("JdlAppTop")) {
footFn.hide(footFn.getId("JdlAppTop"));
}
}
})();
/*兼容页面不满一屏*/
(function() {
window.addEventListener("load", function() {
var Jfoot = footFn.getId("Jfoot");
var Jbody = footFn.getElem("body");
if (!Jfoot) return;
if (!Jbody) return;
function fixFoot() {
var webHeight = document.documentElement.clientHeight,
JbodyHeight = Jbody.clientHeight,
JfootHeight = Jfoot.clientHeight;
if (Jfoot.style.position != "absolute") {
if (JbodyHeight <= webHeight) {
Jfoot.setAttribute("style", "width:100%;position:absolute;bottom:0;left:0;");
};
}else {
if (JbodyHeight + JfootHeight >= webHeight) {
Jfoot.setAttribute("style", "position:static;");
};
};
}
fixFoot();
setInterval(function() {
fixFoot();
}, 1000);
}, false);
})();
/*拨号计数器*/
(function(){var btn=document.getElementsByTagName('a');for(var i=0,len=btn.length;i<len;i++){(function(m){if(btn[m].href.indexOf('tel:')!=-1){btn[m].onclick=function(e){e.preventDefault();var href=this.href;var img=new Image;img.src='http://acount.pcauto.com.cn/wzcount/artbrowse.php?groupname=汽车网&subgroupname=&id=CNT798&title=&response=1';setTimeout(function(){location.href=href;},1000);}}})(i);}})();
/* iresearch */
document.write('<div style="display:none;"><img src="http://irs01.com/irt?_iwt_t=i&_iwt_id=&_iwt_UA=UA-pcauto-000001&r='+(Math.random() * 1e18).toString(36).slice(0, 5).toUpperCase()+'" /></div>');
/*ad test15
if(typeof(isallpage) === 'undefined' || !isallpage){
document.write('<script src="http://jwz.3conline.com/adpuba/auto_default_show?id=auto.wap.test15.&media=js&channel=dynamic"><\/script>');
}
*/
</script>